package com.team10.hotel.service.impl;

import com.team10.hotel.domain.HotelImage;
import com.team10.hotel.mapper.HotelImageMapper;
import com.team10.hotel.service.HotelImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HotelImageServiceImpl implements HotelImageService {
    @Autowired
    private HotelImageMapper hotelImageMapper;
    @Override
    public int saveHotelImage(HotelImage hotelImage) {
      return   hotelImageMapper.insert(hotelImage);
    }

    @Override
    public List<HotelImage> listImage(Integer id) {
        return hotelImageMapper.selectImageByHotelId(id);
    }

    @Override
    public HotelImage findHotelImage(int id) {
        return hotelImageMapper.selectByPrimaryKey(id);
    }

    @Override
    public int deleteHotelImage(int id) {
        return hotelImageMapper.deleteByPrimaryKey(id);
    }


}
